class Pet:
    pet_type = "cat"
    name = ""
    age = 0
#类中所以方法的第一个形参都是self
#self 类似 Java中的this

    def __init__(self,pet_type,name,age):
        self.pet_type=pet_type
        self.name=name
        self.age=age
    def showPet(self):
        print("我的宠物是{},他的名字是{},{}岁了".format(self.pet_type,self.name,self.age))

    def setAge(self,age):
        self.age=age
    def setAgeClass(self,age):
        self.__class__.age=age

    def __del__(self):
        print("name del")
def main():
    dahuang = Pet("dog","dahuang",4)
    dahuang.showPet()
    print("大黄的age是 ",dahuang.__class__.age)
    print("大黄的age的数值是 ",dahuang.age)
    print("=================================")
    dahuang.setAge(7)
    dahuang.setAgeClass(10)
    print("================================")
    print("大黄的age是 ", dahuang.__class__.age)
    print("大黄的age的数值是 ", dahuang.age)
    print("=================================")
main()